<template>
	<view class="">
		<view class="flex align-center p-2 border-bottom border-light-secondary" hover-class="bg-light" @click="openchat">
			<image :src="item.avatar" class="rounded-circle mr-2" style="height: 80rpx;width: 80rpx;">
			</image>
			<view class="flex flex-column flex-1">
				<view class="flex align-center justify-between">
					<text class="fond-md">{{item.username}}</text>
					<text class="font text-secondary">{{item.create_time | formatTime}}</text>
				</view>
				<view class="flex align-center justify-between">
					<view class="text-secondary text-ellipsis" style="max-width: 500rpx;">{{item.data}}</view>
					<uni-badge :text="item.notread" type='error'></uni-badge>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import uniBadge from "@/components/uni-ui/uni-badge/uni-badge.vue"
	import $T from "@/common/time.js"
	export default{
		components: {
			uniBadge
		},
		props:{
			item:Object,
			index:Number
		},
		//时间过滤器 按程序员指定格式输出 1718591077566 现在的时间距离1970年一月一日的毫秒数
		filters:{
			formatTime(value){
				return $T.gettime(value)
			}
		},
		methods:{
			openchat(){
				uni.navigateTo({
					url:"/pages/user-chat/user-chat"
				})
			}
		}
	}
</script>

<style>
</style>